package com.iplay.dao.order;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

import com.iplay.entity.common.EntityIdDO;
import com.iplay.entity.order.ApprovalStatus;
import com.iplay.entity.order.OrderContractDO;
import com.iplay.entity.order.OrderDocIdApprovalStatusDO;

public interface OrderContractDAO extends CrudRepository<OrderContractDO, Integer> {
	
	EntityIdDO findIdById(int id);
	
	@Transactional
	@Modifying
	@Query("update OrderContractDO h set h.approvalStatus = ?2 where h.id = ?1")
	int updateApprovalStatus(int id, ApprovalStatus status);
	
	OrderDocIdApprovalStatusDO findIdApprovalStatusById(int id);
	
	
}
